package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {

    //查询角色列表
    //@Select("select id, name, label, remark, create_time, update_time from role where name like '%${name}%' and label like '%${label}%'")
    List<Role> selectList(String name,String label);


    //添加角色列表
    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);

    //删除角色
    @Delete("delete from role where id= #{id}")
    void deleteById(Integer id);

    //根据ID查询角色
    @Select("select id, name, label, remark, create_time, update_time from role where id= #{id}")
    Role selectById(Integer id);

    //更改角色
    //@Update("update role set name= #{name}, label= #{label}, remark= #{remark}, update_time= #{updateTime} where id= #{id}")
    void updateById(Role role);
}
